import request from '../utils/request'

/**
 * 获取人员列表
 */
export function personnelList(params) {
  return request({
    url: '/api/personnelList',
    method: 'post',
    data: {...params}
  })
}

/**
 * 创建人员
 */
export function store(form) {
  return request({
    url: '/api/personnel',
    method: 'post',
    data: {...form}
  })
}

/**
 * 修改人员
 */
export function edit(id) {
  return request({
    url: `/api/personnel/${id}`,
    method: 'get',
    data: {id}
  })
}

/**
 * 修改行政人员
 */
export function update(form, id) {
  return request({
    url: `/api/personnel/${id}`,
    method: 'put',
    data: {...form, id}
  })
}

/**
 * 删除
 */
export function destroy(ids) {
  return request({
    url: '/api/personnel',
    method: 'delete',
    data: {ids}
  })
}

/**
 * 导入行政人员
 */
export function importAdmin(params) {
  return request({
    url: '/api/importAdmin',
    method: 'post',
    data: {...params}
  })
}

/**
 * 导入驾驶员
 */
export function importDriver(params) {
  return request({
    url: '/api/importDriver',
    method: 'post',
    data: {...params}
  })
}

/**
 * 获取所有人员
 */
export function getAllPersonnel() {
  return request({
    url: '/api/getAllPersonnel',
    method: 'get'
  })
}

/**
 * 创建离职列表
 */
export function departureList(form) {
  return request({
    url: '/api/departureList',
    method: 'post',
    data: {...form}
  })
}
/**
 * 创建离职人员
 */
export function addDeparturePersonnel(form) {
  return request({
    url: '/api/addDeparturePersonnel',
    method: 'post',
    data: {...form}
  })
}
/**
 * 编辑离职人员
 */
export function editDeparturePersonnel(form) {
  return request({
    url: '/api/editDeparturePersonnel',
    method: 'post',
    data: {...form}
  })
}
/**
 * 删除离职人员
 */
export function departureDestroy(form) {
  return request({
    url: '/api/departureDestroy',
    method: 'post',
    data: {...form}
  })
}

/**
 * 创建离职列表
 */
export function injuredList(form) {
  return request({
    url: '/api/injuredList',
    method: 'post',
    data: {...form}
  })
}
/**
 * 创建离职人员
 */
export function addInjuredPersonnel(form) {
  return request({
    url: '/api/addInjuredPersonnel',
    method: 'post',
    data: {...form}
  })
}
/**
 * 编辑离职人员
 */
export function editInjuredPersonnel(form) {
  return request({
    url: '/api/editInjuredPersonnel',
    method: 'post',
    data: {...form}
  })
}
/**
 * 删除离职人员
 */
export function injuredDestroy(form) {
  return request({
    url: '/api/injuredDestroy',
    method: 'post',
    data: {...form}
  })
}

/**
 * 获取考核列表
 */
export function assessmentList(form) {
  return request({
    url: '/api/assessmentList',
    method: 'post',
    data: {...form}
  })
}
